package com.trs.publish.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.trs.publish.domain.RolePower;
import com.trs.publish.repository.RolePowerRepository;

/**
 * @author jia.haihong
 */
@Service
@Transactional
public class RolePowerService{

	@Autowired
    private RolePowerRepository rolePowerRepository;

	public void deleteByRoleId(long roleid) {
		rolePowerRepository.deleteByRoleId(roleid);
	}
	
	public void deleteByPowerId(long powerid) {
		rolePowerRepository.deleteByPowerId(powerid);
	}

	public void batchSave(List<RolePower> list) {
		if(list != null && list.size()>0){
			rolePowerRepository.batchSave(list);
		}
	}
}
